<?php
	
	//$Agent = $_SERVER['HTTP_USER_AGENT'];
	$m3u8_url = "http://vip.".$domain.".com/video.php?token=" . $token . "&format=" . $format. "&mobile=1&guhuo=".$guhuo;
	
	//http://vip.ghmp4.com/video.php?token=179836341460447691&format=m3u8&mobile=1&guhuo=51909219_mmsid
	


	//$content1  =  Get_html($m3u8_url,"html");
	//echo $Agent;
	//$content1  = str_replace("player/ckplayer.js", "http://www.dy4410.com/ckplayer/player/ckplayer.js", $content1);
	//echo $m3u8_url;

	//echo $m3u8_url;
	
	header('Content-Type:application/force-download'); 
	header("Location:".$m3u8_url);
    exit();

?>

<?php

	function Get_html($urls,$types) {
		
		$headers = array(  
			'Accept'=>' */*',  
			'Accept-Encoding'=>' gzip, deflate, sdch',  
			'Accept-Language'=>' ko',  
			'Connection'=>'  keep-alive',      
			'User-Agent'=>'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36',  
		);
			
			$ch = curl_init($urls);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // ?取?据返回  
			curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); // 在?用 CURLOPT_RETURNTRANSFER ?候??取?据返回  
			curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
			curl_setopt ($ch,CURLOPT_REFERER,'http://www.dy4410.com/player/tvyun.php?url=51909219');
			$output = curl_exec($ch);
			curl_close($ch); 

		return $output;	
	}
	
?>